
import request from "@/utils/request";
//基础题库列表
export function getQuestionsList(data) {
  return request({
    url: "/questions",
    method: "GET",
    params:data
  });
}

//删除题库接口
export function deleteQuestions(id) {
    return request({
      url: `/questions/${id}`,
      method: "DELETE",
    });
  }

  //根据id get试题列表
  export function getQuestionsById(id) {
    return request({
      url: `/questions/${id}`,
      method: "GET",
    });
  }

  //加入精选题库接口
  export function addQuestions(id) {
    return request({
      url: `/questions/choice/${id}/1`,
      method: "PATCH",
    });
  }

  //精选图库列表
  export function getChoiceQuestions(data) {
    return request({
      url: "/questions/choice",
      method: "GET",
      params:data
    });
  }

  //学科列表接口
  export function getSujectList(data) {
    return request({
      url: "/subjects/simple",
      method: "GET",
      data
    });
  }
  //目录列表接口
  export function getDirectorysList(data) {
    return request({
      url: `/directorys?subjectID=${data}`,
      method: "GET",
      data
    });
  }
  //标签列表
  export function getTagsList(data) {
    return request({
      url: `/tags?subjectID=${data}`,
      method: "GET",
      data
    });
  }
  //试题审核
 export function checkQuestions (data) {
    return request({
      url: `/questions/check/${data.id}`,
      method: "post",
      data
    });
  }

  //精选题库上下架
  export function QuestionsPublishState (data) {
    return request({
      url: `/questions/choice/${data.id}/${data.publishState}`,
      method: "post",
      data
    });
  }

